﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeExternalSurface : OdGeSurface
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeExternalSurface(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeExternalSurface_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeExternalSurface obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeExternalSurface()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeExternalSurface(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeExternalSurface() : this(GlobalsPINVOKE.new_OdGeExternalSurface__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeExternalSurface(IntPtr pSurfaceDef, OdGe.ExternalEntityKind surfaceKind, bool makeCopy) : this(GlobalsPINVOKE.new_OdGeExternalSurface__SWIG_1(pSurfaceDef, (int)surfaceKind, makeCopy), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeExternalSurface(IntPtr pSurfaceDef, OdGe.ExternalEntityKind surfaceKind) : this(GlobalsPINVOKE.new_OdGeExternalSurface__SWIG_2(pSurfaceDef, (int)surfaceKind), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeExternalSurface(OdGeExternalSurface source) : this(GlobalsPINVOKE.new_OdGeExternalSurface__SWIG_3(OdGeExternalSurface.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getExternalSurface(out IntPtr pSurfaceDef)
		{
			GlobalsPINVOKE.OdGeExternalSurface_getExternalSurface(this.swigCPtr, out pSurfaceDef);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGe.ExternalEntityKind externalSurfaceKind()
		{
			OdGe.ExternalEntityKind result = (OdGe.ExternalEntityKind)GlobalsPINVOKE.OdGeExternalSurface_externalSurfaceKind(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isPlane()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isPlane(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isSphere()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isSphere(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCylinder()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isCylinder(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCone()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isCone(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEllipCylinder()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isEllipCylinder(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEllipCone()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isEllipCone(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isTorus()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isTorus(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isNurbSurface()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isNurbSurface(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isDefined()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isDefined(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isNativeSurface(OdGeSurface nativeSurface)
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isNativeSurface(this.swigCPtr, nativeSurface);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalSurface Assign(OdGeExternalSurface extSurf)
		{
			OdGeExternalSurface result = new OdGeExternalSurface(GlobalsPINVOKE.OdGeExternalSurface_Assign(this.swigCPtr, OdGeExternalSurface.getCPtr(extSurf)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalSurface set(IntPtr pSurfaceDef, OdGe.ExternalEntityKind surfaceKind, bool makeCopy)
		{
			OdGeExternalSurface result = new OdGeExternalSurface(GlobalsPINVOKE.OdGeExternalSurface_set__SWIG_0(this.swigCPtr, pSurfaceDef, (int)surfaceKind, makeCopy), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalSurface set(IntPtr pSurfaceDef, OdGe.ExternalEntityKind surfaceKind)
		{
			OdGeExternalSurface result = new OdGeExternalSurface(GlobalsPINVOKE.OdGeExternalSurface_set__SWIG_1(this.swigCPtr, pSurfaceDef, (int)surfaceKind), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isOwnerOfSurface()
		{
			bool result = GlobalsPINVOKE.OdGeExternalSurface_isOwnerOfSurface(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeExternalSurface setToOwnSurface()
		{
			OdGeExternalSurface result = new OdGeExternalSurface(GlobalsPINVOKE.OdGeExternalSurface_setToOwnSurface(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
